import {
  set_team_name,
  set_user_info
} from '../actions/member';

function organize (state = {
  id: 0,
  name: "",
}, action) {
  switch (action.type) {
    case set_team_name:
      return Object.assign({}, state, {
        name: action.name
      });
    case set_user_info:
      return Object.assign({}, state, {
        id: action.organizeEntity.id,
        name: action.organizeEntity.name
      });
    default:
      return state;
  }
}

export default organize;